/**
 * Wuzhere Javascripts
 * @author Lindsey Simon (elsigh@google.com)
 */

var wuz = {} 

/**
 * Wuzhere initialiazation
 */
wuz.init = function() {
  jQuery('#wuz-website-sign').click(function(e) { 
    jQuery.blockUI({ 
      message: '<h3 id="wuz-loading">Just a moment... </h3>',
      css: {
        backgroundColor: '#fff',
        width: '170px',
        height: '30px',
        padding: '10px',
        fontSize: '150%',
        textAlign: 'left',
        top: '50px'
      }
    });
    
    var url = e.target.href + '?output=ahah';
    jQuery.ajax({ 
      url: url, 
      cache: false, 
      complete: function(e) {
        jQuery.blockUI({ 
          message: e.responseText,
          css: {
            backgroundColor: '#fff',
            width: '500px',
            padding: '10px',
            textAlign: 'left',
            fontSize: '150%',
            top: '50px'
          }
        });
      } 
    }); 
    //window.setTimeout(jQuery.unblockUI, 2000);
    e.preventDefault();
  });
}

/**
 * jQuery style event-bsaed init.
 */
$(document).ready(function() {
  wuz.init();
});
